package net.mihome.app.bean;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 * Created by zhao on 2015/3/18.
 */
public class RepairLogs {
    private int id;
    private int requireId;
    private String content;
    private String createAt;
    private String updateAt;
    private int isDel;

    public  static RepairLogs parse(Map map){
        if(map==null){
            return null;
        }else{
            RepairLogs repairLogs=new RepairLogs();
            Double idsDouble=(Double) map.get("id");
            repairLogs.setId(idsDouble.intValue());
            Double requireIdDouble=(Double) map.get("require_id");
            repairLogs.setRequireId(requireIdDouble.intValue());
            repairLogs.setContent((String) map.get("content"));
            repairLogs.setCreateAt((String) map.get("create_at"));
            repairLogs.setUpdateAt((String) map.get("update_at"));
            return repairLogs;
        }
    }
    public static List<RepairLogs> parseList(List<Map> maps){
        if(maps==null){
            return null;
        }else{
            List<RepairLogs> repairLogses=new ArrayList<>();
            Iterator<Map> iterator=maps.iterator();
            while(iterator.hasNext()){
                Map map=iterator.next();
                RepairLogs repairLogs=RepairLogs.parse(map);
                repairLogses.add(repairLogs);
            }
            return repairLogses;
        }
    }
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getRequireId() {
        return requireId;
    }

    public void setRequireId(int requireId) {
        this.requireId = requireId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getCreateAt() {
        return createAt;
    }

    public void setCreateAt(String createAt) {
        this.createAt = createAt;
    }

    public String getUpdateAt() {
        return updateAt;
    }

    public void setUpdateAt(String updateAt) {
        this.updateAt = updateAt;
    }

    public int getIsDel() {
        return isDel;
    }

    public void setIsDel(int isDel) {
        this.isDel = isDel;
    }
}
